<template>
  <div>
    <!-- title -->
    <PageTitle>
      {{ $t('menu.M_10408800') }}
    </PageTitle>
    <!-- 标题 -->
    <el-tabs v-model="activeTab" @tab-click="handleClick">
      <el-tab-pane :label="'TOMS'" :name="'TOMS'">
        <toms-report ref="tomsReport" />
      </el-tab-pane>
      <el-tab-pane :label="'FlyDesk'" :name="'FLYDESK'">
        <flydesk-report ref="flydeskReport" />
      </el-tab-pane>
      <el-tab-pane :label="'FlyIoT'" :name="'FLYIOT'">
        <flyiot-report ref="flyiotReport" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import { timeFilter, dateFilter } from '@/filters/index'
import FlyiotReport from '@/views/platform-report/component/flyiot-report'
import TomsReport from '@/views/platform-report/component/toms-report'
import FlydeskReport from '@/views/platform-report/component/flydesk-report'
import PageTitle from '@/components/PageTitle/index.vue'
export default {
  name: 'StatisticOperator',
  components: {
    FlydeskReport,
    FlyiotReport,
    TomsReport,
    PageTitle
  },
  data() {
    return {
      activeTab: 'TOMS',
      settings: {
        conditions: [],
        columns: []
      },
      dataListLoading: false,
      selectedData: []
    }
  },
  computed: {},
  mounted() {
    this.$store.commit('app/ADD_KEEP_ALIVE_LIST', 'StatisticOperator')
  },
  beforeRouteLeave(to, from, next) {
    console.log(to.path)
    if (
      to.path !== '/platform-report/flyiot-report-detail' &&
      to.path !== '/platform-report/operator-detail'
    ) {
      this.$store.commit('app/REMOVE_KEEP_ALIVE_LIST', 'StatisticOperator')
    }
    next()
  },
  methods: {
    timeFilter,
    dateFilter,
    handleSelectionChange(val) {
      this.selectedData = val
    },
    handleClick(tab, event) {}
  }
}
</script>
<style lang='scss' scope>
.app-container {
  padding: 20px;
  background: #ffffff;
  border-radius: 8px;

  &--border-none {
    border-radius: 0;
  }
}
</style>
